fib_rec := method(num,
    if(num < 0,
        0,
        if(num < 3,
            1,
            fib_rec(num - 1) + fib_rec(num - 2)
        )
    )
)
for(i, 1, 10, fib_rec(i) println)

fib_loop := method(num,
    if(num < 0,
        0,
        if(num < 3,
            1,
            fnum := 1
            snum := 1
            for(i, 3, num, 
                temp := fnum + snum
                fnum = snum
                snum = temp
            )
        )
    )
)
for(i, 1, 10, fib_loop(i) println)